﻿using System;
using System.Configuration;

namespace Log4net
{
	class Program
	{
		static void Main(string[] args)
		{

			//初始化日志文件 
			string state = ConfigurationManager.AppSettings["IsWriteLog"];
			//判断是否开启日志记录
			if (state == "1")
			{
				var path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase +
						   ConfigurationManager.AppSettings["log4net"];

				var fi = new System.IO.FileInfo(path);
				log4net.Config.XmlConfigurator.Configure(fi);
			}

			LogHelper.WriteLog("holle world");


		}

	}
}